package com._58city.spark.app.ext.dao;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collections;
import java.util.List;

import org.springframework.jdbc.core.simple.ParameterizedRowMapper;

import com._58city.spark.app.ext.dto.ResumeSource;

public class ResumeSourceDao extends BaseDao implements ParameterizedRowMapper<ResumeSource> {
	public List<ResumeSource> select_all() {
		String sql = String.format("select * from %s", super.tableName);
		List<ResumeSource> result = this.jdbcTemplate.query(sql, this);
		if (null != result) {
			return result;
		} else {
			return Collections.emptyList();
		}
	}

	public ResumeSource mapRow(ResultSet rs, int rowNum) throws SQLException {

		ResumeSource res = new ResumeSource();
		res.setCode_id(rs.getInt("code_id"));
		res.setPlatform(rs.getString("platform"));
		res.setSource_name(rs.getString("source_name"));
		return res;
	}
}
